package club.dmyang.service.impl;

import club.dmyang.dao.RoleMapper;
import club.dmyang.entity.Role;
import club.dmyang.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by brss on 2018/6/29.
 */
@Service
public class RoleServiceImpl implements RoleService {

    @Autowired
    private RoleMapper roleMapper;

    /**
     * 按role的名字查找该role，并且联合查询，查到了该role拥有的所有permission
     * @param roleName
     * @return
     */
    @Override
    public Role queryRoleByRoleName(String roleName) {

        Role role = roleMapper.selectbyRoleName(roleName);
        return role;
    }
}
